#!/usr/bin/env python3
# -*- coding: utf-8 -*-

'错误处理机制：try...except...finally...'
class Student(object):
    def isZero(self):
        try:
            print('try:...')
            r = 10 / int('0')
            print('result',r)
        except ValueError as e:
            print('ValueError:',e)
        except ZeroDivisionError as e:
            print('ZeroDivisionError:',e)
        else:
            print('no error!')
        finally:
            print('finally...')
        print('END')


s = Student()
s.isZero()
'''
try:...
except: division by zero
finally...
END
'''